package com.ly.XML;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

import org.junit.Test;

import com.ly.Annotation.RequestMapping;

public class GetReturnProxy {
	public GetReturnProxy(){}

	@Test
	public void getProxy(final GetValue val){
//		    GetReturnValue returnValue = (GetReturnValue)Proxy.newProxyInstance(GetValue.class.getClassLoader(), GetValue.class.getInterfaces(), new InvocationHandler(){
//
//			@Override
//			public Object invoke(Object proxy, Method method, Object[] abj)
//					throws Throwable {
//				// TODO Auto-generated method stub
//				 method.invoke(val, obj);
//				return null;
//			}
//			
//		});
		    Class clazz = GetValue.class;
		    String methodName="";
		    try {
				 Method method = clazz.getMethod("GetReturnValue", new Class[]{});
				if(method.isAnnotationPresent(RequestMapping.class)){
					 RequestMapping anno =(RequestMapping)method.getAnnotation(RequestMapping.class);
					 methodName= anno.value();
				 }else{
					 System.out.println("没有此标签");
				 }
				
				
			} catch (SecurityException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (NoSuchMethodException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		    
		    
		    
	}
}
